﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApplication5.settings;

namespace WindowsFormsApplication5.sheets
{
    public class Config_2620
    {

        MainForm myForm ;

        public Config_2620(MainForm myForm)
        {
            this.myForm = myForm;
        }

        public void create_configsheet(string savepath, string Hostname)
        { 
            StreamWriter SW;
            SW = File.CreateText(savepath + "\\" + myForm.Hostname + ".txt");
            
            // Routergrundkonfiguration
            SW.WriteLine("Host Name: " + myForm.Hostname);
            SW.WriteLine("Message of the Day: " + myForm.Motd);
            SW.WriteLine("Konsolenpasswort: " + myForm.Console_pw);
            SW.WriteLine("Konsolenpasswort: " + myForm.Console_pw_enable);
            SW.WriteLine("Telnetpasswort: " + myForm.Telnet_pw);
            SW.WriteLine("Telnetpasswort: " + myForm.Telnet_pw_enable);
            SW.WriteLine("Benutzerpasswort: " + myForm.User_pw);
            SW.WriteLine("Benutzerpasswort: " + myForm.User_pw_enable);


            //Schnittstellenkonfiguratuion
            SW.WriteLine("Port: " + myForm.Port_serial1);
            SW.WriteLine("Port: " + myForm.Port_enable_serial1);
            SW.WriteLine("Port-Beschreibung: " + myForm.Portdescription_serial1);
            SW.WriteLine("IP: " + myForm.Ip_serial1);
            SW.WriteLine("Clockrate: " + myForm.Clockrate_serial1);

            //Statische Routerkonfiguration
            
            // CHANGE ME  = defaultroute_radioButton.Checked;
            // CHANGE ME  = staticroute_radioButton.Checked;
            
            if (myForm.Defaultroute == true)
	        {
		        SW.WriteLine("Defaultroute checked: ");
	        }
            if (myForm.Staticroute == true)
            {
                SW.WriteLine("Statische IP: " + myForm.Static_ip);
                SW.WriteLine("Subnetmask: " + myForm.Static_subnetmask);
                SW.WriteLine("Next-Hop-IP: " + myForm.Static_nexthopip);    
            }
            
            //Dynamische Routerkonfiguration mit RIPv2
            SW.WriteLine("RIPv2_Direktverbundene Netze: " + myForm.Directconnect_RIPv2);
            SW.WriteLine("RIPv2: " + myForm.Routingprotocol_RIPv2_enable);
            SW.WriteLine("RIPv2_Autovervollstständigung: " + myForm.Autocomplete_RIPv2);

            //Dynamische Routerkonfiguration mit OSPF
            SW.WriteLine("OSPF_Authentifizierung: " + myForm.Authentification_OSPF);
            SW.WriteLine("OSPF_Direktverbundene Netze: " + myForm.Directconnect_OSPF);
            SW.WriteLine("OSPF: " + myForm.Routingprotocol_OSPF_enable);
            
      
            SW.Close();
           
        }
    }
}

